package com.hireceivecard.config;
/**
 *
 * @Description: 自定义异常处理类
 * @Author 2742866928@qq.com
 * @Date: 2024/3/24 0:16
 */
public class AppException extends RuntimeException {
    //异常信息
    private String errMessage;
    //异常状态码
    private int errcode;

    public AppException() {
        super();
    }
    public int getErrcode() {
        return errcode;
    }
    public AppException(String errMessage, int errcode) {
        super(errMessage);
        this.errMessage = errMessage;
        this.errcode = errcode;
    }

    public AppException(String errMessage) {
        super(errMessage);
        this.errMessage = errMessage;
    }

    public static AppException getAppException(String errMessage,int errcode) {
        throw new AppException(errMessage,errcode);
    }

    public static AppException getAppException(String errMessage) {
        throw new AppException(errMessage);
    }
}
